<include file="public@header"/>
<style>html{background-color: #ffffff}</style>
</head>
<body>
<div class="layui-row js-check-wrap">
    <div class="layui-side" style="background: #f5f7f9;">
        <ul class="layui-if-menu">
            <li><i class="icon-icon layui-icon-md-filing"></i><a href="{:url('SlideItem/index',['slide_id'=>$slide_id])}">幻灯片列表</a></li>
            <li><i class="icon-icon layui-icon-md-add-circle"></i><a href="{:url('SlideItem/add',['slide_id'=>$slide_id])}">添加幻灯片</a></li>
            <li class="layui-this"><i class="icon-icon layui-icon-ios-create"></i><a>编辑幻灯片</a></li>
        </ul>
    </div>
    <div class="layui-body" style="padding: 15px 25px 0 15px;">
        <div class="layui-tab-item layui-show">
            <form action="{:url('SlideItem/editPost')}" method="post" class="layui-form js-ajax-form">
                <div class="layui-form-item">
                    <label class="layui-form-label"><span class="form-required">*</span>标题</label>
                    <div class="layui-input-block">
                        <input class="layui-input" type="text"  name="post[title]" id="title"
                               required value="{$result.title}" placeholder="请输入标题"/>
                    </div>
                </div>
 
                <div class="layui-form-item">
                    <label class="layui-form-label">描述</label>
                    <div class="layui-input-block">
                        <input class="layui-input" type="text" name="post[description]" id="source"
                               value="{$result.description}" placeholder="请输入描述">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">幻灯片内容</label>
                    <div class="layui-input-block">
                            <textarea class="layui-textarea" name="post[content]" id="description"
                                      placeholder="请填写幻灯片内容">{$result.content}</textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">缩略图</label>
                    <div class="layui-input-block">
                        <input type="hidden" name="post[image]" id="thumb" value="{$result.image|default=''}">
                        <a href="javascript:uploadOneImage('图片上传','#thumb');">
                            <if condition="empty($result['image'])">
                                <img src="__TMPL__/public/assets/images/default-thumbnail.png"
                                     id="thumb-preview" width="135" style="cursor: hand"/>
                                <else/>
                                <img src="{:cmf_get_image_preview_url($result['image'])}" id="thumb-preview"
                                     width="135" style="cursor: hand"/>
                            </if>
                        </a>
                        <div class="layui-col-md12" style="margin-top: 10px">
                            <input type="button" class="layui-btn layui-btn-sm layui-btn-normal"
                                   onclick="$('#thumb-preview').attr('src','__TMPL__/public/assets/images/default-thumbnail.png');$('#thumb').val('');return false;"
                                   value="取消图片">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <input type="hidden" name="post[id]" value="{$result.id}"/>
                        <input type="hidden" name="post[slide_id]" value="{$slide_id}">
                        <button type="submit" class="layui-btn js-ajax-submit js-ajax-submit">{:lang('SAVE')}</button>
                        <a class="layui-btn layui-btn-primary" href="{:url('SlideItem/index',['slide_id'=>$slide_id])}">{:lang('BACK')}</a>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<include file="public@script"/>
</body>
</html>